﻿@{
    ViewBag.Title = "Home Page";
}


<div class="row">
    <div>
        <form role="form">
            <div class="form-group">
                <label class="control-label" for="t1">表达式</label>
                <input type="text" value="" class="form-control" id="t1" required="required" />
                <span id="result"></span>
            </div>
            <div class="form-group">
                <button type="button" class="btn btn-primary">计算</button>
            </div>
        </form>
    </div>
</div>

@section scripts
{
    <script>
        $(function () {
            $(".btn-primary").click(function () {

                var v = $("#t1").val();

                var d = { "str": v };

                $.post('/home/Calculate',
                    d,
                    function (r) {
                        $("#result").html(r);
                    });
            });
        });
    </script>

}
